package com.cfr.utils;

import org.jbpm.api.ProcessEngine;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ProcessEngineUtils {
	private static ProcessEngine processEngine = null;

	static {
		try {
			ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
					"applicationContext.xml");
			applicationContext.start();
			processEngine = (ProcessEngine) applicationContext
					.getBean("processEngine");
		} catch (Throwable e) {
			throw new ExceptionInInitializerError(e);
		}
	}

	public static ProcessEngine getProcessEngine() {
		return processEngine;
	}
}
